package com.hotelManager.www.controller;

import com.hotelManager.www.po.User;
import com.hotelManager.www.po.Shop;
import com.hotelManager.www.service.UserService;


public class AuthController {
    private final UserService userService = new UserService();
    // 注册逻辑
    public boolean register(User user, Shop shop) {
        if ("merchant".equals(user.getRole())) {
            return userService.registerMerchant(user, shop);
        } else {
            return userService.registerUser(user);
        }
    }

    // 登录逻辑
    public User login(String username, String password) {
        return userService.loginUser(username, password);
    }
}